package com.cserver.pro.exception;


import org.apache.shiro.authz.AuthorizationException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.servlet.ModelAndView;

@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(AuthorizationException.class)
    public Object HandleAuthorizationException() {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("/sysUser/unLogin?code=2");
        return modelAndView;
    }
}
